export const state = () => {
	return {
		username: {}
	};
};
export const mutations = {
	setusername(state, data) {
		state.username = data;
	}
};
export const actions = {
	// login(store,data){
	login({ commit }, data) {
		return this.$axios({
			url: '/accounts/login',
			method: 'POST',
			data: data
		}).then((res) => {
			// console.log(res.data);
			// store.commit('user/setusername', res.data);
			commit('setusername', res.data);
			// console.log(this.$store.state.user.username);
			return res;
		});
	}
};
